package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据id查询菜品关联套餐
     * @param ids
     * @return
     */

    List<Long> getSetmealIdByDishIds(List<Long> ids);

    /**
     * 根据id插入菜品关联
     * @param setmealDishes
     */

    void insertBySid(List<SetmealDish> setmealDishes);



    /**
     * 根据套餐id查询菜品关联
     * @param setmealId
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySid(Long setmealId);

    /**
     * 根据sid删除
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySid(Long setmealId);

    void deleteByids(List<Long> ids);
}
